Week 15, Assignment 15
Networking and Communications
Video - Week Fifteen, Lecture Fifteen
Goal
The goal for this week is to work on networking part, which means getting an understanding on how to communicate between boards, just similar to speaking with one board to another. So here I have to make at least 2 controller board to communicate with each other.
Introduction
This week's assignment exposes application of electronics in Networking and Communication field. It gives the knowledge about communication devices and its protocols.
As the assignment is about Networking and Communication I first went through with the term Networking in Electronics via google and it stated that "networking is the construction, design and use of a network, including the physical (cabling, hub, bridge, switch, router, and so forth), the selection and use of telecommunication protocol and computer software for using and managing the network, and the establishment of operation policies and procedures related to the network. Communication is like talking with two controller boards, so, there are various means of communicating with the boards which are via, RF (Radio Frequency), Bluetooth, GSM, Zigbee, etc. So here I decided to use Bluetooth for communicating the board with wach other and LED Blinks accordingly.
Bluetooth Module:
HC‐05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,designed for transparent wireless serial connection setup.The HC-05 Bluetooth Module can be used in a Master or Slave configuration, making it a great solution for wireless communication.This serial port bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband.
Eagle
I made a Circuit Board one as a Master Board and one as a Slave board to communicate.
Master board which I made is the one I am going to use in my Final Project, with AtMega328P, which is shown below.


Slave board is the one which I made specifically for this weeks assignment only with Attiny 45, and added a LED which will blink as the command is send from the Master Board to the Slave Board through Bluetooth.



Getting Stated
After Making the board and connecting them together so that they can communicate Via Bluetooth Module. I used Arduino IDE for programming the board. I programmed the board such that when I press 1 in the Serial Monitor on Arduino IDE the LED should Blink in the Slave Board taking command from the Master board Via Bluetooth, and as I press any other button except 1 it should stop blinking. I was going to Run both the boards Independently but I need some power to be given to the board so that it could work. So I thought of giving it external power from Battery, but most of the battery in Lab were totally drained, so as a alternative I connect a Arduino to the PC and just took VCC and GND supply from it to Pwoer the Board. Both my Master and Slave board where connected to Bluetooth. Code is shown below:

int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(9600);
pinMode(7,OUTPUT);
pinMode(13,OUTPUT);
// opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
if(incomingByte==49)
{
digitalWrite(13,HIGH);
delay(50);
}
else
{
digitalWrite(13,LOW);
}
Serial.print(incomingByte);
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}